<?php

class Application_Form_GroupChoiceForm extends Zend_Form {

	public function init() {
		$this->setName('groupchoice');
		$session = new Zend_Session_Namespace("codebar");
		
		$id = new Zend_Form_Element_Hidden('id');

		$g = $session->user->getGroupes();
		$champs=array($id);
		$i=1;
		foreach($g as $h)
		{
			$button = new Zend_Form_Element_Submit($h->getName());
			$button->setLabel($i.' : '.$h->getName());
			$button->setValue($h->getId());
			$button->setAttrib('class','button '.$i)
			->setDecorators(array('ViewHelper'));
			$this->addElement($button);
			$i++;
		}

	}

}